/*
* ToolBarDataController.java
* Created on  2015/9/13 12:48
* 版本       修改时间          作者      修改内容
* V1.0.1    2015/9/13       longshihui    初始版本
*
*/

package com.infitecs.eyas.toolbar;

import com.infitecs.eyas.toolbar.model.ToolBar;
import com.infitecs.eyas.toolbar.service.ToolBarDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 类的描述信息
 *
 * @author longshihui
 * @version 1.0.1
 */
@Controller
@RequestMapping("/toolBarData")
public class ToolBarDataController {
    @Autowired
    private ToolBarDataService toolBarDataService;

    @RequestMapping(value = "/add",method = RequestMethod.POST)
    @ResponseBody
    public void add(@RequestBody ToolBar toolBar){
        toolBarDataService.addToolBarData(toolBar);
    }

    @RequestMapping(value = "/del", method = RequestMethod.DELETE)
    @ResponseBody
    public void del(ToolBar toolBar){
        toolBarDataService.deleteToolBar(toolBar.getCalId());
    }

    @RequestMapping(value = "/get", method = RequestMethod.GET)
    @ResponseBody
    public ToolBar get(ToolBar toolBar){
        return toolBarDataService.getToolBarByCalId(toolBar.getCalId());
    }
}
